package com.example.lenovo.demo;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Gravity;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;

import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.example.lenovo.demo.model.databean.CityBean;
import com.example.lenovo.demo.model.databean.ModelDaysBean;
import com.example.lenovo.demo.presenter.MapActivityPresenter;
import com.example.lenovo.demo.presenter.MapFgPresenter;
import com.example.lenovo.demo.view.MapFragment;
import com.example.lenovo.demo.view.ifgview.IMapActivity;

import java.util.ArrayList;
import java.util.List;

public class MapActivity extends AppCompatActivity {
    private int num;
    private RadioGroup radioGroup;
    private MapView mapView;
    private BaiduMap baiduMap;
    private GeoCoder geoCoder;
    private DrawerLayout drawerLayout;
    private IMapActivity iMapActivity;
    private MapActivityPresenter presenter;
    private Bundle bundle;
    private ModelDaysBean modelDaysBean;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);
        bundle=getIntent().getExtras();
        num=bundle.getInt("num");
        modelDaysBean=bundle.getParcelable("msg");
        initView();
        presenter=new MapActivityPresenter();
        iMapActivity=presenter;
        iMapActivity.sendView(this,mapView,num,getSupportFragmentManager(),drawerLayout,modelDaysBean,radioGroup);
        presenter.initData();

    }


    private void initView() {
        radioGroup= (RadioGroup) findViewById(R.id.activity_map_rg);
        mapView= (MapView) findViewById(R.id.citymap_mapview);
        baiduMap=mapView.getMap();
        drawerLayout= (DrawerLayout) findViewById(R.id.activity_map_drawlayout);
        geoCoder = GeoCoder.newInstance();
    }



}
